import tipBox from "./TipBox";
import messageBox from "./messageBox";
export default {
    install(Vue){
        const Tipbox=Vue.extend(tipBox);
        Vue.prototype.$showTip=function(msg="默认值",time=3){
            let tip=new Tipbox();
            tip.msg=msg;
            tip.time=time;
            tip.$mount();
            document.body.appendChild(tip.$el);
            setTimeout(()=>{
                document.body.removeChild(tip.$el);
                tip.$destroy();
            },time*1000)
        };

        const MsgBox=Vue.extend(messageBox);
        window.showMsg=Vue.prototype.$showMsg=function(msg="默认值"){
            let msgBox=new MsgBox();
            msgBox.msg=msg;
            msgBox.$mount();
            document.body.appendChild(msgBox.$el);
        }
    }
}